#!/usr/bin/env bash
set -e
set -u
set -o pipefail

get-one-die() {
    echo 1d$1
}
get-one-row() {
    echo $1: `rolldice $1`
}
print-the-value() {
    local die=`get-one-die $1`
    echo `get-one-row $die`
}
random-dice-set_main() {
    local sides=$1
    for i in `seq 2 20`; do echo `print-the-value $i`; done
    echo `print-the-value 100`
    if [ "$sides" -ne "0" ]; then
        for i in `seq 1 10`; do echo `print-the-value $sides`; done
    fi
}

random-dice-set_main ${1:-0}
